<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/collect.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>



    <style>
        body>.detail-staitics-info .agent-list li{font-size: 12px!important; width:100px;}
        body>.detail-staitics-info .layui-table td, .layui-table th{font-size: 12px!important;}
    </style>






</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>




        <div id="content">
            <h1>项目统计信息</h1>




            <hr/>


            <div class="detail-staitics-info">
                <div class="list-box">
                    <h2>续费收入汇总</h2>
                    <div>
                        <table class="layui-table">
                            <colgroup>
                                <col width="80">
                                <col width="100">
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                                <col >
                            </colgroup><thead><tr><th>序号</th>


                                                <th>续费条目</th>

                                                <th>续费总金额</th>
                                                <th>进行中利润</th>
                                                <th>服务器</th>
                                                <th>域名</th>
                                                <th>公众号</th>
                                                <th>小程序服务器</th>
                                                <th>包年服务</th>
                                                <th>维护费</th>
                                                <th>装修宝</th>
                                                <th>点餐系统</th>
                                                <th>ssl证书</th>
                                            </tr>
                                            </thead>


                                            <tbody>



<tr >
    <td>本阶段</td>
    <td><?echo count($renewal_list) ?></td>

    <td>
        <? $renewal_array = transform_2darray_in_1darray_number_as_key($renewal_list,"sum");
           echo array_sum($renewal_array)?>
    </td>

    <td>
        <? $renewal_cost_array = transform_2darray_in_1darray_number_as_key($renewal_list,"cost");
        echo array_sum($renewal_array)-array_sum($renewal_cost_array)?>
    </td>



    <?
    $type_list=transform_2darray_in_1darray_number_as_key($renewal_list,"type");
    $condition['data']=$type_list;
    $condition['rang']="like";
    ?>
    <td><? $condition['target']="服务器";echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="域名"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="公众号"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="小程序服务器"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="包年服务"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="维护费"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="装修宝"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="点餐系统"; echo count_num_in_array($condition)?></td>
    <td><? $condition['target']="ssl证书"; echo count_num_in_array($condition)?></td>

</tr>






    </tbody>
</table>

 

</div>





                <div class="detail-staitics-info" >
                    <h2>续费收入分析</h2>
                    <div class="layui-form">
                        <table class="layui-table">
                            <colgroup>
                                <col width="100">
                                <col>
                                <col>
                                <col>
                                <col>
                            </colgroup>
                            <thead>
                            <tr>
                                <th>日期</th>
                                <th>服务器</th>
                                <th>域名</th>
                                <th>公众号</th>
                                <th>小程序服务器</th>
                                <th>包年服务</th>
                                <th>维护费</th>
                                <th>装修宝</th>
                                <th>点餐系统</th>
                                <th>ssl证书</th>
                                <th>总数</th>

                            </tr>
                            </thead>
                            <tbody>


                            <tr>
                                <?$profit=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' ");?>
                                <td><b> <?echo date("Y")?></b></td>
                                <td><b> <? echo $gggc=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='服务器' ");?></b> _ <?echo round($gggc/$profit*100,1)?>%</td>
                                <td><b> <? echo $pmsj=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='域名' ");?></b> _ <?echo round($pmsj/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxtg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='公众号' ");?></b> _ <?echo round($wxtg/$profit*100,1)?>%</td>
                                <td><b> <? echo $hdch=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='小程序服务器' ");?></b> _ <?echo round($hdch/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxpt=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='包年服务' ");?></b> _ <?echo round($wxpt/$profit*100,1)?>%</td>
                                <td><b> <? echo $wzkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='维护费' ");?></b> _ <?echo round($wzkf/$profit*100,1)?>%</td>
                                <td><b> <? echo $xtkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='装修宝' ");?></b> _ <?echo round($xtkf/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxgg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='点餐系统' ");?></b> _ <?echo round($wxgg/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxgg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y")."%' and type='ssl证书' ");?></b> _ <?echo round($wxgg/$profit*100,1)?>%</td>
                                <td><?echo $gggc+$pmsj+$wxtg+$hdch+$wxpt+$wzkf+$xtkf+$wxgg+$gysj+$spmt+$snsj?></td>
                            </tr>
                            <tr>
                                <?$profit=sum_total($table_Prefix."renewal_log","sum","paydate like '".date("Y",strtotime("-1 year "))."%'  ");?>
                                <td><b> <?echo date("Y",strtotime("-1 year "))?></b></td>
                                <td><b> <? echo $gggc=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='服务器' ");?></b> _ <?echo round($gggc/$profit*100,1)?>%</td>
                                <td><b> <? echo $pmsj=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='域名' ");?></b> _ <?echo round($pmsj/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxtg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='公众号' ");?></b> _ <?echo round($wxtg/$profit*100,1)?>%</td>
                                <td><b> <? echo $hdch=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='小程序服务器' ");?></b> _ <?echo round($hdch/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxpt=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='包年服务' ");?></b> _ <?echo round($wxpt/$profit*100,1)?>%</td>
                                <td><b> <? echo $wzkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='维护费' ");?></b> _ <?echo round($wzkf/$profit*100,1)?>%</td>
                                <td><b> <? echo $xtkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='装修宝' ");?></b> _ <?echo round($xtkf/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxgg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='点餐系统' ");?></b> _ <?echo round($wxgg/$profit*100,1)?>%</td>
                                <td><b> <? echo $wxgg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y",strtotime("-1 year "))."%' and  type='ssl证书' ");?></b> _ <?echo round($wxgg/$profit*100,1)?>%</td>
                                <td><b> <?echo $gggc+$pmsj+$wxtg+$hdch+$wxpt+$wzkf+$xtkf+$wxgg+$gysj+$spmt+$snsj?></td>
                            </tr>
                            <tr>
                                <td colspan="12">

                                    <?php include 'modules/mod-price-echart.php'; ?>


                                </td>
                            </tr>


                            <?

                            date_default_timezone_set('Asia/Shanghai');
                            $first_day_of_month = date('Y-m',time()) . '-01 00:00:01';
                            $t = strtotime($first_day_of_month);

                            for($ii=0;$ii<14;$ii++){?>
                                <?$profit=sum_total($table_Prefix."renewal_log","sum","paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' ");?>
                                <tr>
                                    <td><?echo date("Y-m",strtotime("-$ii months",$t))?></td>
                                    <td><b> <? echo $gggc=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='服务器' ");?></b> _ <?echo round($gggc/$profit*100,1)?>%</td>
                                    <td><b> <? echo $pmsj=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='域名' ");?></b> _ <?echo round($pmsj/$profit*100,1)?>%</td>
                                    <td><b> <? echo $wxtg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='公众号' ");?></b> _ <?echo round($wxtg/$profit*100,1)?>%</td>
                                    <td><b> <? echo $hdch=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='小程序服务器' ");?></b> _ <?echo round($hdch/$profit*100,1)?>%</td>
                                    <td><b> <? echo $wxpt=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='包年服务' ");?></b> _ <?echo round($wxpt/$profit*100,1)?>%</td>
                                    <td><b> <? echo $wzkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='维护费' ");?></b> _ <?echo round($wzkf/$profit*100,1)?>%</td>
                                    <td><b> <? echo $xtkf=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='装修宝' ");?></b> _ <?echo round($xtkf/$profit*100,1)?>%</td>
                                    <td><b> <? echo $wxgg=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='点餐系统' ");?></b> _ <?echo round($wxgg/$profit*100,1)?>%</td>
                                    <td><b> <? echo $snsj=sum_total($table_Prefix."renewal_log","sum","status = '已审核' and paydate like '".date("Y-m",strtotime("-$ii month ",$t))."%' and type='ssl证书' ");?></b> _ <?echo round($snsj/$profit*100,1)?>%</td>
                                    <td><?echo $gggc+$pmsj+$wxtg+$hdch+$wxpt+$wzkf+$xtkf+$wxgg+$gysj+$spmt+$snsj?></td>
                                </tr>


                            <?}?>




                            </tbody>
                        </table>
                    </div>





                <!--list-box end-->
            </div>

            <!--content端點01-->
        </div>
        <!--maincontent端點01-->
        <br class="clearfloat"/>
    </div>
    <!--container端點01-->
</div>









<?php include_once('../modules/footer.php'); ?> </body>
</html> 